package com.zhq.blog.core.domain.game.support;

import javax.persistence.Entity;
import javax.persistence.PostLoad;
import javax.persistence.Transient;

import com.zhq.blog.core.domain.BasePersistentDomain;

/**
 * @title:AutoBetDetail.java
 * @package com.zhq.blog.core.domain.game.support
 * @author 张恒强
 * @date 2014年12月26日 下午2:55:40
 * @version V1.0
 */
@Entity
public class AutoBetDetail extends BasePersistentDomain<AutoBetDetailRepository>{
	
	private long autoBetId;
	
	private long modelId;
	
	private long winningUseModelId;
	
	private long loseUseModelId;
	
	
	@Transient
	private CathecticModel model;
	
	@Transient
	private CathecticModel winningUseModel;
	
	@Transient
	private CathecticModel loseUseModel;
	
	@Transient
	private String name;
	
	@Transient
	private long totalBetMoney;
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getTotalBetMoney() {
		return totalBetMoney;
	}

	public void setTotalBetMoney(long totalBetMoney) {
		this.totalBetMoney = totalBetMoney;
	}

	@PostLoad
	public void init(){
		CathecticModel model = context.getCathecticModelRepository().findOne(modelId);
		if (model != null) {
			this.name = model.getName();
			this.totalBetMoney = model.getTotalBetMoney();
		}
	}
	
	public long getAutoBetId() {
		return autoBetId;
	}

	public void setAutoBetId(long autoBetId) {
		this.autoBetId = autoBetId;
	}

	public long getModelId() {
		return modelId;
	}

	public void setModelId(long modelId) {
		this.modelId = modelId;
	}

	public long getWinningUseModelId() {
		return winningUseModelId;
	}

	public void setWinningUseModelId(long winningUseModelId) {
		this.winningUseModelId = winningUseModelId;
	}

	public long getLoseUseModelId() {
		return loseUseModelId;
	}

	public void setLoseUseModelId(long loseUseModelId) {
		this.loseUseModelId = loseUseModelId;
	}

	public CathecticModel getModel() {
		return model;
	}

	public void setModel(CathecticModel model) {
		this.model = model;
	}

	public CathecticModel getWinningUseModel() {
		return winningUseModel;
	}

	public void setWinningUseModel(CathecticModel winningUseModel) {
		this.winningUseModel = winningUseModel;
	}

	public CathecticModel getLoseUseModel() {
		return loseUseModel;
	}

	public void setLoseUseModel(CathecticModel loseUseModel) {
		this.loseUseModel = loseUseModel;
	}
}
